<script type="text/javascript">
    layui.use(['index', 'treeSelect','xmSelect'], function () {
        var treeSelect = layui.treeSelect;
        treeSelect.render({
            elem: '#block',
            data: "{{route('admin.resume.block.tree')}}",
            placeholder: '请选择',
            success: function (data) {
                let block = '{{$template->block}}';
                if (block != null && block != '')
                    treeSelect.checkNode('block', block);
            }
        });
        var xmSelect = layui.xmSelect;
        $.ajax({
            url: "{{route('admin.base.station.list')}}",
            success: function (data) {
                var xm = xmSelect.render({
                    el: '#stations', 
                    filterable: true,
                    prop: {
                        name: 'name',
                        value: 'station_id',
                    },
                    name: 'stations',
                    data: data.data
                });
                var s = "{{$template['stations']}}";
                var ss = s.split(",");
                xm.setValue(ss)
            }
        });
    });

</script>
